package com.tastesport.chat.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tastesport.chat.model.user.User;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper extends BaseMapper<User> {
//    @Update("update tastesport_user set gold_coin=#{money} where id=#{userId}")
//    Integer updateAccount(double money, Integer userId);

    @Select("select count(*) from user where id=#{userId}")
    Integer userCount(Integer userId);

    @Select("SELECT id,username,nickname,user_icon FROM user where id=#{userid}")
    User user(String userid);

    @Select("select username accountName,nickname name,user_icon profile_picture from user where id=#{userId}")
    User getById(Integer userId);

    @Select("select user_id from chat_manager")
    List<String> getManager();

}
